import 'package:flutter/material.dart';

import '../searchPage.dart';

class CategoryPage extends StatefulWidget {
  const CategoryPage({super.key});

  @override
  State<CategoryPage> createState() => _CategoryPageState();
}

class _CategoryPageState extends State<CategoryPage> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(children: [
        ElevatedButton(
            onPressed: () {
              Navigator.of(context)
                  .push(MaterialPageRoute(builder: (BuildContext context) {
                return const SearchPage(title: 'route Params');
              }));
            },
            child: Text('基本路由跳转')),
        SizedBox(
          height: 30,
        ),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, '/search');
            },
            child: Text('命名路由跳转')),
        SizedBox(
          height: 30,
        ),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, '/form',
                  arguments: {"title": "this is params", "aid": 20});
            },
            child: Text('命名路由跳转, 并传参')),
        SizedBox(
          height: 30,
        ),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(
                context,
                '/dialog',
              );
            },
            child: Text('to dialog')),
            SizedBox(
          height: 30,
        ),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(
                context,
                '/swiper',
              );
            },
            child: Text('to swiper'))
      ]),
    );
  }
}
